function GetHTTPObject()
{
	var xhr; 
    try {  xhr = new ActiveXObject('Msxml2.XMLHTTP');   }
    catch (e) 
    {
        try {   xhr = new ActiveXObject('Microsoft.XMLHTTP');    }
        catch (e2) 
        {
          try {  xhr = new XMLHttpRequest();     }
          catch (e3) {  xhr = false;   }
        }
    }
	return xhr;
}

function GetPageContent(Type, Url, Params, Callback, cbParam, Sync)
{
	var xhr = GetHTTPObject();
	xhr.onreadystatechange = function()
	{
		if(xhr.readyState == 4 && Callback != null)
		{
			if(xhr.status == 200 || xhr.status == 0)
				Callback(true, xhr.responseText, cbParam);
			else
				CallBack(false, "Error code : " + xhr.status, cbParam);
		}
	};

	xhr.open(Type, Url, Sync);
	if(Type == "POST")
	{
		xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xhr.send(Params);
	}
	else
	{
		xhr.send(null);
	}
}